<?php
/**
 * Created by PhpStorm.
 * User: xiao
 * Date: 2017/6/15
 * Time: 下午2:24
 */

namespace app\src\payment\helper;

class PayCodeHelper
{

    const ALPAY_ORDER = 'AL';

    const WXPAY_ORDER = 'WX';

    /**
     * 订单号生成
     * @param $type
     * @param $id
     * @return bool|string
     */
    public static function create($type, $id)
    {
        if(!in_array($type, [self::ALPAY_ORDER, self::WXPAY_ORDER])) return false;
        return $type.date('YmdH').'P'.$id;
    }
}